import correct from '@/mock/correct';
import { Subject } from 'rxjs';
import { AnswersID, AnswersTestID, CommitID, StuID, WorkID } from '..';

export type PlantHomeWork = {
  /**作业ID */
  id: WorkID;
  /**作业类型	 */
  type: number;
  /**作业总分	 */
  score: number;
  /**客观题总分 */
  objective_score: number;
  /**主观题信息*/
  details: Array<SubjectInfo>;
};
export type SubjectInfo = {
  /**试题顺序ID */
  id: AnswersID;

  tests: Array<{
    test_id: AnswersTestID;
    test_type: number;
    test_score: number;
  }>;
};
/**学员作业信息 */
export type StdHomeWork = {
  /**学生ID	*/
  stu_id: StuID;
  /**学生姓名*/
  stu_name: string;
  /**学生的作业提交信息*/
  commit: StdHomeWorkCommit;
  /**作业批改信息*/
  correct?: StdHomeWorkCorrect;
  /**作业的客观题信息	*/
  object?: { object_score: number };
  /**作业是否被驳回 1 是  0 否	*/
  rejected: ERejected;
  /**驳回原因	 */
  reject_reason: string;
  /**批改端端显示的状态0 待批改，1 即将超时，   2 已超时， 3 已批改	 */
  timeout_status: ECommitStatus;
  /**批改端端显示的状态名称	 */
  timeout_desc: string;
  /**错题信息，用于订正时获取那些试题需要批改
   */
  wrong_test_ids: Array<{ id: AnswersID; test_id: AnswersTestID }>;
  /**作业是否已批改 */
  correctComplete?: Boolean;
  /**金币计算系数 */
  factor: string;
  /**客观题获得的金币数量 */
  gold_num: number;
};

export type SimplifyUrls = {
  /**id */
  id: AnswersID;
  /**图像url */
  img_url: string;
};
export type ImgUrls = {
  /**id */
  id: AnswersID;
  /**图像url */
  img_urls: string;
};
/**学生提交 */
export type StdHomeWorkCommit = {
  /**作业提交ID	 */
  commit_id: CommitID;
  /**作业提交时间	 */
  commit_time: string;
  /**作业作态	 */
  status: ECommitStatus;
  /**作业状态名称	 */
  status_name: string;
  /**提交状态 */
  details: Array<ImgUrls>;
};

export type CorrectDetails = {
  /**试题次序ID	 */
  id: AnswersID;
  /**教师批改的URL	 */
  img_urls: string;
  /**批改得分详情	*/
  scores: Array<CorrectDetailsScores>;
};
export type CorrectDetailsScores = {
  /**子小题ID	 */
  test_id: AnswersTestID;
  /**试题的分数	 */
  test_score: number;
  /**学生获得的分数	 */
  stu_score?: number;
};
export type StdHomeWorkCorrect = {
  /**语音总评	 */
  audio_url: string;
  /**文字总评	 */
  comment: string;
  /**学生批改详细	 */
  details: Array<CorrectDetails>;
  /**批改时间	 */
  correct_time: string;
  /**订正时间	 */
  revise_time: string;
};

/**1 随堂测  2 演讲秀 3 演说家 4 考试 5 课堂辩论会 6 乐探究 */
export enum EWorkType {
  /** 随堂测*/
  inClass = 1,
  /** 演讲秀*/
  lecture = 2,
  /**演说家 */
  speech = 3,
  /** 考试*/
  exam = 4,
  /**课堂辩论会 */
  debate = 5,
  /**乐探究 */
  explore = 6
}
export enum ECommitStatus {
  waitMarked = 0,
  overtimeimg = 1,
  overtime = 2,
  marked = 3
}

export enum ERejected {
  reject = 0,
  noReject = 1
}
